package com.mapgis.utils

import java.io.InputStreamReader
import java.util.Properties

object PropertiesUtil {

  def load(propertiesName:String): Properties ={
    val prop=new Properties()
    prop.load(new InputStreamReader(Thread.currentThread().getContextClassLoader.getResourceAsStream(propertiesName) , "UTF-8"))
    prop
  }

  //测试时使用的
  def main(args: Array[String]): Unit = {
    //    val properties: Properties = PropertiesUtil.load("config.properties")
    //    println(properties.getProperty("kafka.broker.list"))
    //    val properties: Properties = PropertiesUtil.load("time.txt")
    //    val strings = properties.stringPropertyNames()
    //    println(strings)
  }
}
